package main.fileiterators;

import data.ConfigurationGraphData;
import data.Saver;

public class ImprovementAnalyzer implements SaverPerformer {

	private int counter = 0;
	private int impCounter = 0;

	@Override
	public void doWithSaver(Saver s) {
		ConfigurationGraphData d = s.loadConfiguration(1);
		if (d.get_ppp().size()>1){
			impCounter++;
		}
		counter++;
	}

	@Override
	public String printResults() {
		return impCounter + " Machines can be improved out of " + counter + " ("+(((double)impCounter/(double)counter)*100.0)+"%)";
	}

}
